﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="MarkControle.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Quadro Geral
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


    
    <h2>Agenda Mensal</h2><br /><h1 style="margin-left:45%; font-size:x-large;"> <%switch((int)Session["tempmes"]){case 1:%>Janeiro<%break;%><%case 2:%>Fevereiro<%break;%><%case 3:%>Marco<%break;%><%case 4:%>Abril<%break;%><%case 5:%>Maio<%break;%><%case 6:%>Junho<%break;%><%case 7:%>Julho<%break;%><%case 8:%>Agosto<%break;%><%case 9:%>Setembro<%break;%><%case 10:%>Outubro<%break;%><%case 11:%>Novembro<%break;%><%case 12:%>Dezembro<%break;}%><%="/"+Session["tempano"].ToString()%></h1>
    <br /><%:Html.ActionLink("Voltar","Voltar")%>
     <% List<tarefa> tarefas = new List<tarefa>(); tarefas = (List<tarefa>)ViewData["listtarefas"];%><%Session["volta"] = "I"; %>
     <%Session["temporio"] = tarefas; %>
     <%List<Funcionario> funcionarios = new List<Funcionario>(); funcionarios = (List<Funcionario>)ViewData["funci"]; funcionarios.Sort(); %>
     <%int a=0;int b=0; %> 
     <%foreach (Funcionario fun in funcionarios)
       {%>  <%List<tarefa> tarefunc=new List<tarefa>();%>
            <% using (Html.BeginForm("Desbloq", "Home", FormMethod.Post))
              { %>
             
              <%foreach(tarefa tarif in tarefas){ %>
               <%if (tarif.Encarregados[0] == fun.Username || tarif.Encarregados[1] == fun.Username || tarif.Encarregados[2] == fun.Username)
                 {
                     switch (tarif.Status1) { case 0: fun.Trf = fun.Trf + 1; break; case 1: fun.Trfadiadas = fun.Trfadiadas + 1; break; case 2:fun.Trfatrasadas = fun.Trfatrasadas + 1; break; case 3:fun.Trfcumpridas = fun.Trfcumpridas + 1; break; }%>
                 <%tarefunc.Add(tarif);
                 }
                } tarefunc.Sort();%>



      
     
       <table>
       <h3>_____________________________________________________________________________________________________________________________________</h3>
       <tr>
       <th class="style1">Nome</th>
       <th class="style7">Login</th>
       <th style="height: 36px; width: 72px;">Área</th>
       <th class="style9">Trfs Cumpridas</th>
       <th style="height: 36px; width: 108px;">Trfs Arasadas</th>
       <th style="height: 36px; width: 112px;">Trfs Pendentes</th>
       <th style="height: 36px; width: 222px;">Trfs Adiadas</th>
       <th style="height: 36px">Bloqueado</th>
       </tr>
       <%string resp; if (fun.Bloq == 0) { resp = "Não"; } else {resp = "Sim"; }resp=resp+"["+a.ToString()+"]";%>
       <tr>
       <td class="style2"><%=fun.Nome%></td>
       <td class="style8"><%=fun.Username%></td>
       <td style="height: 127px; width: 72px;"><%=fun.Area%></td>
       <td class="style10"><%=fun.Trfcumpridas%></td>
       <td style="height: 127px; width: 108px;"><%=fun.Trfatrasadas%></td>
       <td style="height: 127px; width: 112px;"><%=fun.Trf%></td>
       <td style="height: 127px; width: 222px;"><%=fun.Trfadiadas%></td>
       <td style="height: 127px"><input type="submit" name="bb" value="<%:resp %>" /></td>
       </tr>
       </table>
       <%Session["a"+a.ToString()] = fun;a++; %>
     <%} %>
       <table>
    <tr>
    <th class="style3"></th>
    <th class="style5">Prazo</th>
    <th class="style13">Informações</th>
    <th class="style11">Responsáveis</th>
    <th style="width: 225px; height: 32px;">Data Requisição</th>
    <th style="width: 138px; height: 32px;">Status</th>
    <th style="width: 352px; height: 32px;">Comentários</th>
    </tr>
   
     <%foreach (tarefa tarif in tarefunc)
       {%>
       <%using (Html.BeginForm("Editarif", "Home", FormMethod.Post)){%>
          <%string del = "Delete(" + b.ToString() + ")";%>

    <tr><%string[] enc = new string[4]; enc = tarif.Encarregados; tarif.Enca1 = enc[0]; tarif.Enca2 = enc[1]; tarif.Enca3 = enc[2]; %>
    <td class="style4"><input type="submit" name="input" value="<%:del%>" /></td>
    <td class="style6"><%=tarif.Prazo.Date%></td>
    <td class="style14"><%=tarif.Informacoes%></td>
    <td class="style12"><%=tarif.Encarregados[0] + "/" + tarif.Encarregados[1] + "/" + tarif.Encarregados[2]%></td>
    <td style="width: 225px; height: 180px;"><%=tarif.Datarequisicao.Date%></td>
    <td style="width: 138px; height: 180px;"><%if (tarif.Status1 == 0)
                                               {%>Pendente<%}
                                               else if (tarif.Status1 == 1)
                                               {%>Adiada<%}
                                               else if (tarif.Status1 == 2)
                                               {%>Atrasada<%}
                                               else
                                               {%>Cumprida<%}%></td>
    <td style="width: 352px; height: 180px;"><%=tarif.Comentarios%></td>
    </tr>
   
    <%Session[b.ToString()] = tarif;b++;
           } %>
           
     <%}}%>
     
     </table>
    
     <style type="text/css">h3{ color:Red;}
         .style1
         {
             height: 36px;
             width: 112px;
         }
         .style2
         {
             height: 127px;
             width: 112px;
         }
         .style3
         {
             height: 32px;
             width: 166px;
         }
         .style4
         {
             height: 180px;
             width: 166px;
         }
         .style5
         {
             height: 32px;
             width: 218px;
         }
         .style6
         {
             height: 180px;
             width: 218px;
         }
         .style7
         {
             height: 36px;
             width: 82px;
         }
         .style8
         {
             height: 127px;
             width: 82px;
         }
         .style9
         {
             height: 36px;
             width: 119px;
         }
         .style10
         {
             height: 127px;
             width: 119px;
         }
         .style11
         {
             height: 32px;
             width: 191px;
         }
         .style12
         {
             height: 180px;
             width: 191px;
         }
         .style13
         {
             height: 32px;
             width: 596px;
         }
         .style14
         {
             height: 180px;
             width: 596px;
         }
     </style>
     
     
     


</asp:Content>
